(function() {"use strict";var __module = CC_EDITOR ? module : {exports:{}};var __filename = 'preview-scripts/assets/Script/PinBall.js';var __require = CC_EDITOR ? function (request) {return cc.require(request, require);} : function (request) {return cc.require(request, __filename);};function __define (exports, require, module) {"use strict";
cc._RF.push(module, '1425dKR+9xGg7ZU60YngSUI', 'PinBall', __filename);
// Script/PinBall.js

"use strict";

cc.Class({
    extends: cc.Component,

    properties: {},
    onLoad: function onLoad() {
        cc.log("[Ball]ball onLoad");
    },
    start: function start() {
        cc.log("[Ball]ball start");
        // this.node.position = cc.v2(0,0);//初始化位置
        // this.getComponent(cc.RigidBody).linearVelocity = cc.v2(10,10);//初始化速度
        this.rigidBody = this.getComponent(cc.RigidBody);
        cc.log("[Ball]position=" + this.node.position);
        cc.log("[Ball]enabledContactListener=" + this.rigidBody.enabledContactListener);
        cc.log("[Ball]angularDamping=" + this.rigidBody.angularDamping);
        cc.log("[Ball]angularVelocity=" + this.rigidBody.angularVelocity);
        cc.log("[Ball]linearVelocity=" + this.rigidBody.linearVelocity);
    }
}

// onBeginContact(contact, self, other) {
//     switch (other.tag) {
//         case 1://球碰到砖块
//             //this.gameCtl.onBallContactBrick(self.node, other.node);
//             break;
//         case 2://球碰到地面
//            // this.gameCtl.onBallContactGround(self.node, other.node);
//             break;
//         case 3://球碰到托盘
//            // this.gameCtl.onBallContactPaddle(self.node, other.node);
//             break;
//         case 4://球碰到墙
//           //  this.gameCtl.onBallContactWall(self.node, other.node);
//             break;
//     }
// },

//    // 只在两个碰撞体结束接触时被调用一次
//    onEndContact: function (contact, selfCollider, otherCollider) {
//     cc.log("[Ball] collison ball end");
//     if (otherCollider.tag == 99) {
//         let rigidBody2 = selfCollider.getComponent(cc.RigidBody);
//         // 获取移动速度
//         // cc.log("[Ball]linearVelocity="+rigidbody2.linearVelocity);
//         // var velocity = rigidbody.linearVelocity*2;//初始化速度;
//         // // 设置移动速度
//         // rigidbody.linearVelocity = velocity;
//         // cc.log("[Ball]linearVelocity2="+rigidbody.linearVelocity);
//     }
// },
);

cc._RF.pop();
        }
        if (CC_EDITOR) {
            __define(__module.exports, __require, __module);
        }
        else {
            cc.registerModuleFunc(__filename, function () {
                __define(__module.exports, __require, __module);
            });
        }
        })();
        //# sourceMappingURL=PinBall.js.map
        